home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Developer's Kit 1996
/
Delphi Developer's Kit 1996.iso
/
power
/
timetest
/
read.me
next >
Wrap
Text File
|
1995-12-22
|
2KB
|
51 lines
The I/O Checking Check Box Mystery
This little form was meant to be used to compare various
string search strategies and other performance enhancing opportunities.
While experimenting with the effects of turning on and off the various
run time error checking options, a funny thing happened.
With I/O Checking checked, execution time was 2.5 to 3 times faster
than with it unchecked.
Adding a {$I+} or {$I-} to the code made no difference. Time and
again I checked and unchecked the box and checking it made a big
difference. NOTHING else was changed.
The routines being timed have no I/O in them whatever. One is StrPos
and the other is a similar routine written in assembler.
As I was packaging up this little test version for the curious among
you, I rebuilt the project in another directory.
Well now I am totally mystified. NOW it works the other way around.
Selecting I/O Checking in the Options | Project | Compiler slows the
program down 2.5 to 3 times. Not selecting it speeds it up. Now this is
more intuitive, except for the fact that there are no I/O routines
inside the timing loops.
How did it reverse when I rebuilt everything? Is it possible for Delphi
to lose track of checked vs unchecked? Was something else slowing the
execution down when I checked the box? It happened at least ten times
with Compile|Build between each and every test.
OK, it's the next day. I built up the program again and now there
is no difference, checked or unchecked. If I had any hair left, I
would be pulling it out.
Anyone got any ideas. Slowing a program down by a factor of 3 is
pretty important when you are about to search a gig or more of
text... If this were an application, I probably wouldn't have noticed
that something was going on.
Let me know what you discover. Use the timer to make your own methods
more efficient. Brought to you by the I hate to wait crowd.
Peter Jennings
peterj@netcom.com